
 
 E v e n t :   " s u b T r e e C h a n g e " 
 
 
 
 D e s c r i p t i o n :   S e t s   a   c h a n g e   h a n d l e r   t o   e x i c u t e   w h e n   o n e   o r   m o r e   e l e m e n t s   a r e   a d d e d   o r   r e m o v e d   f r o m   t h e   s p e c i f i e d   D O M   c o n t a i n e r   e l e m e n t . 
 
 
 
 R e t u r n s :   d o m E l e m e n t   o r   m a t c h i n g   n o d e   a r r a y ,   o r   $ A   o b j e c t   i f   c h a i n e d . 
 
 
 
 N o t e :   T h i s   e v e n t   u t i l i z e s   t h e   M u t a t i o n   O b s e r v e r   A P I . 
 
 h t t p s : / / d e v e l o p e r . m o z i l l a . o r g / e n - U S / d o c s / W e b / A P I / M u t a t i o n O b s e r v e r 
 
 
 
 E x a m p l e : 
 
 
 
     / /   B i n d   a   c h a n g e   h a n d l e r   t o   a   D O M   c o n t a i n e r   e l e m e n t . 
 
 
 
     $ A ( t a r g e t C o n t a i n e r E l e m e n t ) . o n ( " s u b T r e e C h a n g e " ,   f u n c t i o n ( M u t a t i o n O b j e c t ,   t a r g e t C o n t a i n e r E l e m e n t ,   a r r a y O f A d d e d N o d e s ,   a r r a y O f R e m o v e d N o d e s ,   B o u n d O b j e c t O r D C ,   S a v e d D a t a )   { 
 
         / /   D o   s o m e t h i n g   w i t h   a r r a y O f A d d e d N o d e s   o r   a r r a y O f R e m o v e d N o d e s . 
 
         / /   B o u n d O b j e c t O r D C   p o p u l a t e s   w h e n   t h e   t a r g e t C o n t a i n e r     i s   b o u n d   u s i n g   $ A . b i n d O b j e c t s ( ) ,   o r   i s   b o u n d   t o   a   D C   i n s t a n c e . 
 
         / /   S a v e d D a t a   p o p u l a t e s   w h e n   s a v e d   e v e n t   p a r a m e t e r s   a r e   s p e c i f i e d   u s i n g   t h e   $ A . o n   e v e n t   s y n t a x .   ( H e l p / $ A   A P I / D O M   E v e n t s / O n )   
 
     } ) ; 
 
 